from flask import Blueprint, request, jsonify
from app import db
from app.models.company import Company

companies_bp = Blueprint('companies', __name__, url_prefix='/companies')

# 获取所有公司
@companies_bp.route('', methods=['GET'])
def get_companies():
    companies = Company.query.all()
    return jsonify([company.to_dict() for company in companies]), 200
